package com.ygqh.baby.model;

import java.math.BigDecimal;

public class PrizeItemRule {

	private Integer itemIndex;

	private Integer startCount;

	private Integer endCount;

	private BigDecimal targetRate;

	private BigDecimal totalRate;

	// ===此次抽奖概率
	private BigDecimal thisRate;

	public PrizeItemRule() {
		super();
	}

	public PrizeItemRule(Integer itemIndex, Integer startCount, Integer endCount, BigDecimal targetRate, BigDecimal totalRate) {
		super();
		this.itemIndex = itemIndex;
		this.startCount = startCount;
		this.endCount = endCount;
		this.targetRate = targetRate;
		this.totalRate = totalRate;
	}

	public BigDecimal getTargetRate() {
		return targetRate;
	}

	public void setTargetRate(BigDecimal targetRate) {
		this.targetRate = targetRate;
	}

	public Boolean inThisRule(int count) {
		count = count +1;
		if (startCount <= count && endCount >= count) {
			return true;
		}
		return false;
	}

	public Integer getStartCount() {
		return startCount;
	}

	public void setStartCount(Integer startCount) {
		this.startCount = startCount;
	}

	public Integer getEndCount() {
		return endCount;
	}

	public void setEndCount(Integer endCount) {
		this.endCount = endCount;
	}

	public Integer getItemIndex() {
		return itemIndex;
	}

	public void setItemIndex(Integer itemIndex) {
		this.itemIndex = itemIndex;
	}

	public BigDecimal getTotalRate() {
		return totalRate;
	}

	public void setTotalRate(BigDecimal totalRate) {
		this.totalRate = totalRate;
	}

	public BigDecimal getThisRate() {
		return thisRate;
	}

	public void setThisRate(BigDecimal thisRate) {
		this.thisRate = thisRate;
	}

	@Override
	public String toString() {
		return "PrizeItemRule [itemIndex=" + itemIndex + ", startCount=" + startCount + ", endCount=" + endCount
				+ ", totalRate=" + totalRate + ", thisRate=" + thisRate + "]";
	}

}
